home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 19 / bix01.zip / MOUSDEMO.PAS < prev    next >
Pascal/Delphi Source File  |  1986-07-07  |  1KB  |  58 lines

  1.  
  2.  
  3. program mtrial;
  4. { demonstration program. get two points with the mouse and
  5.   connect them with a line }
  6.  
  7. type
  8.     curarray = array[0..31] of INTEGER;
  9.  
  10. var
  11.     cursor  :  curarray;
  12.     i,nbut,mx,my,mbt,x,y  :  integer;
  13. {$I MOUSE.PAS }
  14.  
  15. procedure bdraw;
  16. begin
  17.    gotoxy(1,2);
  18.    write('Use left button for first point, right button for second point.');
  19.    mshow;
  20.    repeat
  21.       mpos(mbt,x,y)
  22.    until mbt=1;
  23.    mhide;
  24.    plot(x,y,1);
  25.    mshow;
  26.    repeat
  27.       mpos(mbt,mx,my)
  28.    until mbt=2;
  29.    mhide;
  30.    draw (x,y,mx,my,1);
  31. end;
  32.  
  33. begin                        {MTRIAL main line}
  34.    for i := 0 to 3 do        {load cursor image in hex}
  35.       cursor[i] := $FFFF;    {these values could be set up as typed constants}
  36.    cursor[4] := $F00F;
  37.    for i := 5 to 10 do
  38.       cursor[i] := $F7EF;
  39.    cursor[11] := $F00F;
  40.    for i := 12 to 15 do
  41.       cursor[i] := $FFFF;
  42.    for i := 16 to 19 do
  43.       cursor[i] := $0000;
  44.    cursor[20] := $0FF0;
  45.    for i := 21 to 26 do
  46.       cursor[i] := $0810;
  47.    cursor[27] := $0FF0;
  48.    for i := 28 to 31 do
  49.       cursor[i] := $0000;
  50.    HiRes;
  51.    HiResColor(10);               {set color green}
  52.    mstatus(i,nbut);              {initialize mouse}
  53.    mshape(8,8,cursor);           {set cursor shape}
  54.    mshow;                        {display cursor}
  55.    bdraw                         {get 2 points and draw line}
  56. end.
  57.  
  58.